package thread;

public class Thread2 extends  Thread {
    public Thread2(String name){
        super(name);
    }

    @Override
    public void run() {
         for(int i=1;i<=30;i++){
             System.out.println(super.getName()+" print "+i);
         }
    }

    public static void main(String[] args) {
        for(int i=1;i<=4;i++){
            new Thread2("线程"+i).start();
        }
        //当前线程
        System.out.println(Thread.currentThread().getName()+"主线程");

    }
}
